<?php

include_once( ROOT . 'lib/biz.function.php' );


if( isset( $_REQUEST['tag'] ))
{
	$tag = $_REQUEST['tag'];

	if( intval( $_REQUEST['page'] ) < 1 ) $page = 1 ; else $page = $_REQUEST['page'];
	$page_num = intval( _conf( 'CONTENT_PER_PAGE' ) );

	$start = ( $page-1 ) * $page_num;

	$page_all = ceil( get_content_num_by_tag(  ([$module_id]) , $tag ) /$page_num );
	$pager = get_pager( $page , $page_all , Array( 'a' , 'search_text' , 'tag' ) );

	$t = _tpl();
	$t->set( 'title' , "([$dy_module_content])列表" );
	$t->set( 'top_title' , "([$dy_module_content])列表" );
	$t->set( 'lines' , get_content_by_tag( ([$module_id]) , $tag , $start , $page_num ) );
	$t->set( 'pager' , $pager );
	echo $t->autoFetch( __FILE__ );
}
else
{
	$text = _s( $_REQUEST['search_text']  );
	if( intval( $_REQUEST['page'] ) < 1 ) $page = 1 ; else $page = $_REQUEST['page'];
	$page_num = intval( _conf( 'CONTENT_PER_PAGE' ) );

	$start = ( $page-1 ) * $page_num;

	$page_all = ceil( get_content_num_by_search_text(  ([$module_id]) , $text ) /$page_num );
	$pager = get_pager( $page , $page_all , Array( 'a' , 'search_text' , 'tag' ) );

	$t = _tpl();
	$t->set( 'title' , "([$dy_module_content])列表" );
	$t->set( 'top_title' , "([$dy_module_content])列表" );
	$t->set( 'lines' , get_content_by_search_text( ([$module_id]) , $text , $start , $page_num ) );
	$t->set( 'pager' , $pager );
	echo $t->autoFetch( __FILE__ );
}





?>